Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend): fix UploadPipeline/UploadPipelineVersion v2 API returns v1 object. #9064

Merged
merged 1 commit into from
Mar 30, 2023

Conversation

chensun
Copy link
Member

@chensun chensun commented Mar 30, 2023

Description of your changes:
While integrating with v2 API, we noticed that UploadPipeline API always return v1 object (with resource references).
/cc @jlyaoyuli

Checklist:

@gkcalat
Copy link
Member

gkcalat commented Mar 30, 2023

Thank you @chensun!

/lgtm
/approve

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gkcalat

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have a test for UploadPipeline(), maybe we can add a test for UploadPipelineVersion() too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UploadPipelineVersion() is highly similar to UploadPipeline(), but that isn't a good excuse at all. I agree with you we should have better test coverage here. I will follow up on improving the test coverage shortly.

if createdPipelineVersion == nil {
s.writeErrorToResponse(w, http.StatusInternalServerError, util.NewInternalServerError(errors.New("Failed to convert internal pipeline version representation to its v1beta1 API counterpart"), "Failed to create a pipeline version due to error converting it to API"))
if api_version == "v1beta1" {
err = marshaler.Marshal(w, toApiPipelineVersionV1(newPipelineVersion))
Copy link
Contributor

@Linchin Linchin Mar 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the previous code, we have a check for the output of toApiPipelineVersionV1() to be nil or not. I wonder if we should keep it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toApiPipelineVersionV1() per its current implementation never returns nil. So the previous code wasn't useful.

@google-oss-prow google-oss-prow bot merged commit 01c87f8 into kubeflow:master Mar 30, 2023
@chensun chensun deleted the upload-pipeline-fix branch March 30, 2023 19:51
rd-pong pushed a commit to rd-pong/pipelines that referenced this pull request Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants